"use strict";
cc._RF.push(module, 'f829042pW9Jk7NvhFVsnxpf', 'PlatformUtil');
// Script/PlatformUtil.ts

Object.defineProperty(exports, "__esModule", { value: true });
var DefaultPlatform_1 = require("./DefaultPlatform");
var WebAndroidPlatform_1 = require("./WebAndroidPlatform");
var WebIOSPlatform_1 = require("./WebIOSPlatform");
var WXGamePlatform_1 = require("./WXGamePlatform");
var IOSPlatform_1 = require("./IOSPlatform");
var AndroidPlatform_1 = require("./AndroidPlatform");
var PlatformUtil = /** @class */ (function () {
    function PlatformUtil() {
    }
    PlatformUtil.init = function () {
        console.log(cc.sys.os);
        switch (cc.sys.platform) {
            case cc.sys.WECHAT_GAME:
                console.log("微信小游戏平台");
                this.platform = new WXGamePlatform_1.default();
                break;
            case cc.sys.ANDROID:
                this.platform = new AndroidPlatform_1.default();
                break;
            case cc.sys.IPHONE:
            case cc.sys.IPAD:
                console.log("ios平台");
                this.platform = new IOSPlatform_1.default();
                break;
            default:
                if (cc.sys.isBrowser) {
                    switch (cc.sys.os) {
                        case cc.sys.OS_ANDROID:
                            this.platform = new WebAndroidPlatform_1.default();
                            break;
                        case cc.sys.OS_IOS:
                            this.platform = new WebIOSPlatform_1.default();
                            break;
                        default:
                            this.platform = new DefaultPlatform_1.default();
                            break;
                    }
                }
                else {
                    this.platform = new DefaultPlatform_1.default();
                }
                break;
        }
        window['platform'] = this.platform;
    };
    return PlatformUtil;
}());
exports.default = PlatformUtil;

cc._RF.pop();